{layout name="Layout/layout" /}
<link rel="stylesheet" type="text/css" href="/static/css/UpYun.css">
<style>
    .img_gray {
        filter: grayscale(100%);
        -webkit-filter: grayscale(100%);
        -moz-filter: grayscale(100%);
        -ms-filter: grayscale(100%);
        -o-filter: grayscale(100%);
    }
</style>
<div class="row">
    <div class="col-sm-12">
        <div class="wrapper wrapper-content animated fadeInUp">
            <div class="ibox">
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="m-b-md">
                               <!-- <a href="project_detail.html#" class="btn btn-white btn-xs pull-right">编辑项目</a>-->
                                <h2>原始借款请求编辑</h2>
                            </div>
                            <dl class="dl-horizontal">
                                <dt>审核状态：</dt>
                                <dd><span class="label label-primary">{$status_map[$info['status']]}</span>
                                </dd>
                            </dl>
                        </div>
                    </div>
                    <form action="/merchant/borrower/doEditBorrowDetail" method="post">
                        <input name="info[bq_id]" value="{$info['bq_id']}" hidden>
                        <input name="info[bq_type]" value="{$info['bq_type']}" hidden>
                    <div class="row">
                        <div class="col-sm-5">
                            <dl class="dl-horizontal">
                                <dt>创建时间：</dt><dd>{$info['create_time']}</dd>
                              <!--  <dt>消息：</dt><dd>162</dd>
                                <dt>客户：</dt><dd><a href="project_detail.html#" class="text-navy"> 百度</a></dd>
                                <dt>版本：</dt><dd>v1.4.2</dd>-->
                            </dl>
                        </div>
                        <div class="col-sm-7" id="cluster_info">
                            <dl class="dl-horizontal">
                                <dt>最后更新：</dt> <dd>{if condition="strtotime($info['update_time'])>0"}{$info['update_time']}{else /}--{/if}</dd>
                              <!--  <dt>创建于：</dt><dd>2014年 2月16日 03:01</dd>-->
                            </dl>
                        </div>
                    </div>
                    <div class="row m-t-sm">
                        <div class="col-sm-12">
                            <div class="panel blank-panel">
                                <div class="panel-heading">
                                    <div class="panel-options">
                                        <ul class="nav nav-tabs">
                                          <!--  <li class="active">
                                                <a href="#tab-1" data-toggle="tab">基本信息</a>
                                            </li>
                                            <li><a href="#tab-2" data-toggle="tab">其他信息</a></li>-->
                                            <li class="active">
                                                <a href="#tab-def" data-toggle="tab">基本信息概览</a>
                                            </li>
                                            <?php foreach($excleMap['field_tab'] as $key =>$val){?>
                                                <li>
                                                    <a href="#tab-{$key}" data-toggle="tab">{$val['title']}</a>
                                                </li>
                                            <?php }?>
                                           <!-- <li><a href="#tab-3" data-toggle="tab">借款信息</a></li>-->
                                        </ul>
                                    </div>
                                </div>

                                <div class="panel-body">

                                    <div class="tab-content">

                                        <div class="tab-pane active" id="tab-def">
                                            <div class="feed-activity-list">
                                                <div class="feed-element">
                                                    <div class="pull-left">姓名：</div>
                                                    <div class="media-body ">
                                                        <input disabled value="{$info['real_name']}" class="form-control"><br>
                                                    </div>
                                                </div>

                                                <div class="feed-element">
                                                    <div class="pull-left">手机号：</div>
                                                    <div class="media-body ">
                                                        <input disabled value="{$info['user_phone']}" class="form-control"><br>
                                                    </div>
                                                </div>
                                                {if condition="$info['bq_type'] == $type_personshop || $info['bq_type'] == $type_personcar"}
                                                <div class="feed-element">
                                                    <div class="pull-left">身份证:</div>
                                                    <div class="media-body ">
                                                        <input disabled value="{$info['idcard']}" class="form-control"><br>
                                                        <br>
                                                        <div class="pull-left">
                                                            <a>
                                                                <img  {if condition="$info['fornt_card']"}
                                                                        src= "{$upyun_prefix}/{$info['fornt_card']}"
                                                                      {else \} src="\static\img\idcard_fornt.png"
                                                                        class="img_gray"
                                                                      {/if} alt="身份证正面"
                                                                    style="width: 300px; height: 150px">
                                                            </a>
                                                            <a>
                                                                <img  {if condition="$info['back_card']"}
                                                                        src= "{$upyun_prefix}/{$info['back_card']}"
                                                                        {else \} src="\static\img\idcard_back.png"
                                                                        class="img_gray"
                                                                        {/if} alt="身份证反面" style="width: 300px; height: 150px">
                                                            </a>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div class="feed-element">
                                                    <div class="pull-left">身份证正面:</div>
                                                    <div class="media-body ">
                                                        <div id="idcard_fornt"></div>
                                                    </div>
                                                </div>

                                                <div class="feed-element">
                                                    <div class="pull-left">身份证反面:</div>
                                                    <div class="media-body ">
                                                        <div id="idcard_backend"></div>
                                                    </div>
                                                </div>
                                                {/if}
                                                <div class="feed-element">
                                                    <div class="pull-left">支付密码：</div>
                                                    <div class="media-body ">
                                                        <strong>{if condition="$info['is_set_pay_password']"}已设置{else/}未设置{/if}</strong> <br>
                                                    </div>
                                                </div>

                                                <!--<?php foreach($excleMap['sql_map'] as $key =>$val){?>
                                                  <div class="feed-element">
                                                    <div class="pull-left">{$val['title']}：</div>
                                                    <div class="media-body">
                                                        <input disabled name="info[{$val['field']}]" value={if condition="isset($info[$val['field']])"}
                                                          "{$info[$val['field']]}"{else /}""{/if} class="form-control"><br>
                                                        {if condition="$val['field'] == 'repayment_type' "}
                                                         <p>还款方式（1：到期还本息；2：按月付息，到期还本；3：按季付息，到期还本；4：等额本息）</p>
                                                        {/if}
                                                    </div>
                                                </div>
                                                <?php }?>-->
                                            </div>

                                        </div>

                                      <!--  <div class="tab-pane" id="tab-2">
                                            <div class="feed-activity-list">
                                                <script>var file_src_ids = [];</script>
                                                <?php foreach($excleMap['json_map'] as $key => $val){ ?>
                                                <?php
                                                    if( $val['field'] =='phone' ||
                                                        $val['field'] =='idcard' ||
                                                        $val['field'] =='real_name'){continue;
                                                    }
                                                 ?>
                                                {if condition="isset($val['field_type']) && $val['field_type']=='file_url'"}
                                                <div class="feed-element">
                                                    <div class="pull-left"> {$val['title']}({$val['ext']})：</div>
                                                    <div class="media-body ">
                                                        {if condition="isset($extra_filed[$val['field']])"}
                                                          <a href="{$upyun_prefix}/{$extra_filed[$val['field']]}">下载</a>
                                                        {/if}
                                                        <script>
                                                            var temp = new Array();
                                                            temp['field'] = "{$val['field']}";
                                                            temp['ext'] = "{$val['ext']}";
                                                            file_src_ids.push(temp);</script>
                                                        <div id="{$val['field']}"></div>
                                                    </div>
                                                </div>
                                                {else/}
                                                 <div class="feed-element">
                                                    <div class="pull-left"> {$val['title']}：</div>
                                                    <div class="media-body ">
                                                        <input name="info[{$val['field']}]" value= {if condition="isset($extra_filed[$val['field']])"}
                                                        "{$extra_filed[$val['field']]}"{else /} ""{/if} class="form-control"> <br>
                                                    </div>
                                                </div>
                                                {/if}

                                                <?php }?>
                                            </div>

                                        </div>-->

                                        <?php $arr_jsonSqlMerger = array_merge($excleMap['json_map'],$excleMap['sql_map']);?>
                                        <script>var file_src_ids = [];</script>
                                        <?php foreach($excleMap['field_tab'] as $tab_key =>$tab_val){ ?>
                                          <div class="tab-pane" id="tab-{$tab_key}">
                                              <div class="feed-activity-list">
                                                <?php foreach($arr_jsonSqlMerger as $key => $val){ ?>
                                                <?php
                                                    if( $val['field_tab'] !=$tab_key){
                                                        continue;
                                                    }
                                                 ?>
                                                {if condition="isset($val['field_type']) && $val['field_type']=='file_url'"}
                                                <div class="feed-element">
                                                    <div class="pull-left"> {$val['title']}({$val['ext']})：</div>
                                                    <div class="media-body ">
                                                        {if condition="isset($extra_filed[$val['field']])"}
                                                        <a href="{$upyun_prefix}/{$extra_filed[$val['field']]}" download="{$upyun_prefix}/{$extra_filed[$val['field']]}">下载</a>
                                                        {/if}
                                                        <script>
                                                            var temp = new Array();
                                                            temp['field'] = "{$val['field']}";
                                                            temp['ext'] = "{$val['ext']}";
                                                            var src = '';
                                                            {if condition="isset($extra_filed[$val['field']])"}
                                                                src = "{$extra_filed[$val['field']]}";
                                                            {/if}
                                                            temp['src'] = src;
                                                            file_src_ids.push(temp);
                                                        </script>
                                                        <div id="{$val['field']}"></div>
                                                    </div>
                                                </div>
                                                {else/}
                                                <div class="feed-element">
                                                    <div class="pull-left"> {$val['title']}：</div>
                                                    <div class="media-body ">
                                                        <input name="info[{$val['field']}]"
                                                        value=  {if condition="isset($extra_filed[$val['field']])"}
                                                        "{$extra_filed[$val['field']]}"

                                                        {elseif condition="isset($info[$val['field']])" /}
                                                        "{$info[$val['field']]}"
                                                        {else/}
                                                          "--"
                                                        {/if}
                                                        class="form-control"
                                                        {if condition="$val['field']=='legal_person'||
                                                          $val['field']=='mobile' ||
                                                          $val['field']=='phone' ||
                                                          $val['field']=='real_name' ||
                                                          $val['field']=='idcard'
                                                        "}readonly {/if}> <br>
                                                        {if condition="$val['field'] == 'repayment_type' "}
                                                        <p>还款方式（1：到期还本息；2：按月付息，到期还本；3：按季付息，到期还本；4：等额本息）</p>
                                                        {/if}
                                                    </div>
                                                </div>
                                                {/if}
                                                <?php }?>
                                              </div>

                                        </div>
                                        <?php }?>


                                    </div>
                                    <div class="col-sm-4 col-sm-offset-10" style="margin-top: 20px;">
                                        <button class="btn btn-primary" type="submit">保存内容</button>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <div class="col-sm-1">
        <!--<div class="wrapper wrapper-content project-manager">
            <h4>项目描述</h4>
            <img src="img/wenku_logo.png" class="img-responsive">
            <p class="small">
                <br>在线互动式文档分享平台，在这里，您可以和千万网友分享自己手中的文档，全文阅读其他用户的文档，同时，也可以利用分享文档获取的积分下载文档
            </p>
            <p class="small font-bold">
                <span><i class="fa fa-circle text-warning"></i> 高优先级</span>
            </p>
            <h5>项目标签</h5>
            <ul class="tag-list" style="padding: 0">
                <li><a href="project_detail.html"><i class="fa fa-tag"></i> 文档</a>
                </li>
                <li><a href="project_detail.html"><i class="fa fa-tag"></i> 分享</a>
                </li>
                <li><a href="project_detail.html"><i class="fa fa-tag"></i> 下载</a>
                </li>
            </ul>
            <h5>项目文档</h5>
            <ul class="list-unstyled project-files">
                <li><a href="project_detail.html"><i class="fa fa-file"></i> Project_document.docx</a>
                </li>
                <li><a href="project_detail.html"><i class="fa fa-file-picture-o"></i> Logo_zender_company.jpg</a>
                </li>
                <li><a href="project_detail.html"><i class="fa fa-stack-exchange"></i> Email_from_Alex.mln</a>
                </li>
                <li><a href="project_detail.html"><i class="fa fa-file"></i> Contract_20_11_2014.docx</a>
                </li>
            </ul>
            <div class="m-t-md">
                <a href="project_detail.html#" class="btn btn-xs btn-primary">添加文档</a>

            </div>
        </div>-->
    </div>
</div>

<script type="text/javascript" src="/static/js/common.js?b"></script>
<script>
    $(document).ready(function () {

        file_src_ids.forEach(function(ele,index){
//            console.log(ele['field']);
//            if(ele['src'] != ''){
//                console.log(ele['src']);
//            }
            toUpYun.init('chaoebao/merchant/',ele['field'],'',ele['ext'], ele['src']);
        });
        //身份证 正反面
        var idcard_fornt = '';
        {if condition="$info['fornt_card']"}
            idcard_fornt= "{$info['fornt_card']}";
        {/if}
        var idcard_backend = '';
        {if condition="$info['back_card']"}
            idcard_backend= "{$info['back_card']}";
        {/if}
        toUpYun.init('chaoebao/merchant/','idcard_fornt','image/jpeg','jpg',idcard_fornt);
        toUpYun.init('chaoebao/merchant/','idcard_backend','image/jpeg','jpg',idcard_backend);
    });
</script>